package com.yehui.first;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class SpringFirstTest {
    public static void main(String[] args) {
        //   AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(FirstConfig.class);
//        MyBeanPostProcessor myBeanPostProcessor = context.getBean(MyBeanPostProcessor.class);
//        myBeanPostProcessor.printApp();
//        context.getBeanFactory().addBeanPostProcessor(new EBeanPostProcessor());
//        //子类
//        context.addBeanFactoryPostProcessor(new ADefinitionRegistryPostProcessor());
//        //父类
//        context.addBeanFactoryPostProcessor(new TestBeanFactoryProcessor());
//        context.refresh();
//
//        A a = context.getBean(A.class);
//        a.printInfo();
        //默认的无参数构造方法
//        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
//        GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
//         beanDefinition.setBeanClass(B.class);
//        C c  =new C();
//        beanDefinition.setInstanceSupplier(c::create);
//        context.registerBeanDefinition("b",beanDefinition);
//        context.refresh();
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(FirstConfig.class);
//		PublistListListener publistListListener = context.getBean(PublistListListener.class);
//		publistListListener.send();
		MyEntity myEntity = context.getBean(MyEntity.class);
		myEntity.add();
	}
}
